# evaluate_model.py
import os
import glob
from metrics import evaluate_dataset

def evaluate(result_dir, gt_dir):
    preds = sorted(glob.glob(os.path.join(result_dir, "*.png")))
    gts = sorted(glob.glob(os.path.join(gt_dir, "*.png")))

    f, mae = evaluate_dataset(preds, gts)
    print(f"[Evaluation] F-measure: {f:.4f}, MAE: {mae:.4f}")
